﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Demo_G.O.S.E.ServerEngine.Map
{
    [System.Runtime.InteropServices.StructLayout( System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 1 )]
    public struct Tile
    {
        internal short m_ID;
        internal sbyte m_Z;

        public int ID
        {
            get { return m_ID; }
        }

        public int Z
        {
            get { return m_Z; }
            set { m_Z = (sbyte)value; }
        }

        public int Height
        {
            get
            {
                //if ( m_ID < 0x4000 )
                //{
                return 0;
                //}
                //else
                //{
                //    return TileData.ItemTable[m_ID & 0x3FFF].Height;
                //}
            }
        }

        public bool Ignored
        {
            get { return ( m_ID == 2 || m_ID == 0x1DB || ( m_ID >= 0x1AE && m_ID <= 0x1B5 ) ); }
        }

        public Tile( short id, sbyte z )
        {
            m_ID = id;
            m_Z = z;
        }

        public void Set( short id, sbyte z )
        {
            m_ID = id;
            m_Z = z;
        }
    }
}

